<h3><B>商户总店</B></h3>
<br>

<form class="form-inline">
    <a ng-click="addRetailer()" class="btn-primary btn-sm nodecoration">添加商户</a>

    <div class="form-group" style="margin-left: 30px">
        <label for="exampleInputName2">商铺名称</label>
        <input type="text" class="form-control" id="exampleInputName2" ng-model="name">
    </div>
    <button type="submit" class="btn btn-default" ng-click="searchRetailer(name)">检索</button>
</form>
<br>
<br>
<div class="tab-content">
    <div class="tab-pane active" id="tab_a">
        <table class="table table-condensed">
            <thead>
            <tr>
                <th>商铺编号</th>
                <th>商铺名称</th>
                <th>联系人</th>
                <th>联系电话</th>
                <th>合作开始日期</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="retailer in retailerList">
                <td>{{retailer.id}}</td>
                <td>{{retailer.retailer_name}}</td>
                <td>{{retailer.contact_name}}</td>
                <td>{{retailer.phone}}</td>
                <td>{{retailer.starting_time}}</td>
                <td>
                    <a class="btn btn-secondary btn-xs"
                       ng-click="editRetailer(retailer)">编辑</a>
                    <a class="btn btn-secondary btn-xs"
                       ng-click="gotoRetailerBranch(retailer.id)">商铺分店维护</a>
                    <a class="btn btn-secondary btn-xs"
                       ng-click="deleteMainRetailer(retailer.id)">删除</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="modal fade" id="zong_model" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h5 class="modal-title" id="myModalLabel">添加商铺总店></h5>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" name="backendUserForm">
                    <div class="form-group">
                        <label for="inputLoginId" class="control-label col-xs-2">商铺名称:</label>

                        <div class="col-xs-3">
                            <input type="text" class="form-control" ng-model="retailer.retailer_name"
                                   required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputUserName" class="control-label col-xs-2">联系人:</label>

                        <div class="col-xs-3">
                            <input type="text" class="form-control" ng-model="retailer.contact_name"
                                   >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputUserName" class="control-label col-xs-2">联系电话:</label>

                        <div class="col-xs-3">
                            <input type="text" class="form-control" ng-model="retailer.phone"
                                   >
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="5" class="control-label col-xs-2">合作开始日期</label>

                        <div class="col-xs-3">
                            <input type="text" id="cooperationDate" data-provide="datepicker"
                                   class="form-control datepicker" data-date-format="yyyy-mm-dd"
                                   ng-model="retailer.starting_time" required>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button id="saveButton" type="submit" class="btn btn-default" ng-click="saveRetailer(retailer)">
                            保存
                        </button>
                        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancelSave()">取消
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>